package com.yeyaomai.dksns.flowis.service.impl;

import javax.annotation.Resource;

import org.springframework.data.mongodb.core.mapreduce.GroupByResults;
import org.springframework.stereotype.Service;

import com.yeyaomai.dksns.flowis.dao.EngineDao;
import com.yeyaomai.dksns.flowis.domain.Engine;
import com.yeyaomai.dksns.flowis.service.EngineService;

/**
 * 搜索引擎Service层实现
 * @author sun_shan
 * 
 */
@Service
public class EngineServiceImpl implements EngineService {

	@Resource
	private EngineDao engineDao;

	@Override
	public void insertEngine(Engine engine) {
		engineDao.insertEngine(engine);
	}

	@Override
	public Engine getEngineById(Integer id) {
		return engineDao.getEngineById(id);
	}

	@Override
	public GroupByResults<Engine> findEngineByEngineNameAndTimeBetween(String from, String to) {
		return engineDao.findEngineByEngineNameAndTimeBetween(from, to); 
	}

	@Override
	public long countSearchTimeByCreateTime(String createTime) {
		return engineDao.countSearchTimeByCreateTime(createTime);
	}

	@Override
	public long countSearchTimeByEngineNameAndCreateTime(String engineName,String createTime) {
		return engineDao.countSearchTimeByEngineNameAndCreateTime(engineName,createTime);
	}


}
